﻿@model IEnumerable<KRM.Core.vIntranetReport4And5>

@{
    ViewBag.Title = "Report 4 and 5";
    Layout = "~/Views/Shared/_Layout.cshtml";
}
<script src="~/js/tabletocsv.js"></script>
<div class="container-fluid">
    <div style="padding-top: 20px">
        <form action="/intranet/report4and5" method="GET">
            <div class="row-fluid">
                <div class="span1">Store:</div>
                <div class="span3">@Html.DropDownList("StoreId", null, new { @class = "input-block-level" })</div>
                <div class="span2">
                    <button type="submit" class="btn btn-primary">Result View</button></div>
            </div>
            <div class="row-fluid">
                <div class="span6">
                    @Html.Partial("Partial/_DateRange")
                </div>
            </div>
        </form>
        <div class="row-fluid">
            @if (Model != null && Model.Any())
            {
                <a class="btn" style="padding: 0; max-height: 30px" onclick="ExportCSV($('#tbreport4and5'), 'from@(Request["dateFrom"])to@(Request["dateTo"])_report4and5.csv') ">
                    <img src="/img/icon-exel.png" style="max-height: 30px">
                </a>
                <table class="table table-bordered table-fix" id="tbreport4and5">
                    <tr>
                        <th>email</th>
                        <th>ReviewerName</th>
                        <th>OrderRef</th>
                        <th>Rating</th>
                    </tr>
                    @foreach (var item in Model)
                    {
                        <tr>
                            <td>@item.email </td>
                            <td>@item.reviewerName </td>
                            <td>@item.OrderRef</td>
                            <td>@item.rating</td>
                        </tr>
                    }
                </table>
            }
            else
            {
               if (Model != null){<div class="alert alert-danger">No result found.</div>} 
            }
        </div>
    </div>
</div>
